// import com.alibaba.druid.sql.ast.*;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.Collections;
// import java.util.List;
#pragma once
#include <string>
#include <list>
#include "../SQLExprImpl.h"
#include "../SQLReplaceable.h"
#include "../../../utils/common_ptr.h"

class SQLName;

class SQLSequenceExpr_Function
{
public:
  static SQLSequenceExpr_Function NextVal;
  static SQLSequenceExpr_Function CurrVal;
  static SQLSequenceExpr_Function PrevVal;

  string_ptr  name;
  string_ptr  nameLCase;
  uint64_t mask;

  SQLSequenceExpr_Function(uint64_t mask, string_ptr  name);
  SQLSequenceExpr_Function(SQLSequenceExpr_Function* function);
};

class SQLSequenceExpr : public SQLExprImpl, virtual public SQLReplaceable
{
public:
  SQLName_ptr sequence;
  std::shared_ptr<SQLSequenceExpr_Function> function;

  SQLSequenceExpr();

  SQLSequenceExpr(SQLName_ptr sequence, std::shared_ptr<SQLSequenceExpr_Function> function);
  SHAREDOBJECT(SQLSequenceExpr);

  virtual SQLObject_ptr clone();

  //@Override
  void accept0(SQLASTVisitor_ptr visitor);

  //@Override
  BOOL_ptr replace(SQLExpr_ptr expr, SQLExpr_ptr target);

  SQLObject_list_ptr  getChildren();

  SQLName_ptr getSequence();

  void setSequence(SQLName_ptr sequence);

  std::shared_ptr<SQLSequenceExpr_Function> getFunction();

  void setFunction(std::shared_ptr<SQLSequenceExpr_Function> function);

  //@Override
  int hashCode();

  //@Override
  bool equals(Object_ptr obj);
};
